import { createApp } from 'vue'
import { getStore } from '@/utils/util'

const app = createApp({})

// 自定义指令 操作按钮
const has = app.directive('has', {
  mounted: function (el, binding, vnode) {
    // 获取权限数组
    let rolesArr = getStore('rolesArr')
    if (!rolesArr.includes(binding.value)) {
      el.parentNode.removeChild(el)
    }
  }
})

export { has }
